package com.base_data_handler.function.weather;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.parser.JSONScanner;
import com.base_data_handler.function.model.Focast2HRain;
import com.base_data_handler.function.model.ProImg;
import com.base_data_handler.function.model.ProRdarImg;
import com.base_data_handler.utils.DataSourceUtils;
import com.base_data_handler.utils.HttpRequest;

public class ChinaWeatherImage {

	private	static QueryRunner qr=new QueryRunner(DataSourceUtils.getDatasSource());
	//获取三小时降水预报与图片
	public static void get3Rain() throws SQLException{
		String jsonList=HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/fo/json/r3h_list.json", "callback=getData&_="+System.currentTimeMillis(),1,null,null);
//		 System.out.println(jsonList.replace("getData(", "").replace(")", ""));
		   JSONObject json = (JSONObject) JSON.parse(jsonList.replace("getData(", "").replace(")", ""));
		   JSONArray arr = JSON.parseArray(json.getString("datas"));
		     String  proType= json.getString("proType");
		   String  picDt=json.getString("picDt");
		   ProImg pi=null;
		   List<ProImg> list=new ArrayList<>();
		   JSONObject jo=null;
		   for (int i = 0; i < arr.size(); i++) {
			   pi=new ProImg();
			   jo=(JSONObject) arr.get(i);
			   pi.setDir("img/r3h");
			   pi.setPicDt(picDt);
			   pi.setProType(proType);
			   pi.setDt(jo.getString("dt"));
			   pi.setPicPath(jo.getString("picPath"));
			   HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/fo/images/r3h/"+((JSONObject) arr.get(i)).getString("picPath"), null, 2,((JSONObject) arr.get(i)).getString("picPath"),"img/r3h");
			   list.add(pi);
		   }
		   proData2Db(list);
		   
	}
	
	//获取临近2小时降水预报
	public static void getComingRain(String sqlNotIn) throws SQLException{
//		String jsonList=HttpRequest.sendGet("http://d3.weather.com.cn/webgis_rain_new/webgis/minute", "lat=35.658467&lon=103.754652&stationid=101160205&callback=fc5m&_="+System.currentTimeMillis(),1,null,null);
//		System.out.println(jsonList);
		 List<Focast2HRain> list = getPosition(sqlNotIn);
		 Focast2HRain f2r=null;
		 List<Focast2HRain> saveList=new ArrayList<>();
		 JSONObject json=null;
		 String jsonList,jsonStr;
		for (int i = 0; i < list.size(); i++) {
			 f2r=list.get(i);
			 jsonList=HttpRequest.sendGet("http://d3.weather.com.cn/webgis_rain_new/webgis/minute",
					"lat="+f2r.getLat()+"&lon="+f2r.getLng()+"&stationid="+f2r.getCounty_weather()+"&_="+System.currentTimeMillis(),1,null,null);
			 System.out.println(jsonList);
			 json=JSON.parseObject(jsonList);
			 if(json.getString("status").equals("true")){
				 f2r.setTimes(json.getString("times"));
				 f2r.setValues(json.getString("values"));
				 f2r.setPh(json.getString("ph"));
				 f2r.setPro_time(json.getString("time"));
				 f2r.setMsg(json.getString("msg"));
				 saveList.add(f2r);
			 }
		}
		focast2Hrain2Db(saveList);
	}
	
	private static void focast2Hrain2Db(List<Focast2HRain> list) throws SQLException {
//		System.out.println(list.toString());
		Object[][] params=new Object[list.size()][14];
		StringBuilder sb=new StringBuilder();
		sb.append("insert into d_2hours_forcast")
		.append("(county_name,county_weather,lat,lng,pro_time,times,value,ph,msg,update_time)")
		.append(" values(?,?,?,?,?,?,?,?,?,now())")
		.append(" ON DUPLICATE KEY UPDATE  ")
		.append(" update_time=now(),")
		.append(" pro_time=?,")
		.append(" times=?,")
		.append(" value=?,")
		.append(" ph=?,")
		.append(" msg=?");
		Focast2HRain f2r=null;
		
		for (int i = 0; i < list.size(); i++) {
			f2r=list.get(i);
			params[i][0]=f2r.getCounty_name();
			params[i][1]=f2r.getCounty_weather();
			params[i][2]=f2r.getLat();
			params[i][3]=f2r.getLng();
			params[i][4]=f2r.getPro_time();
			params[i][5]=f2r.getTimes();
			params[i][6]=f2r.getValues();
			params[i][7]=f2r.getPh();
			params[i][8]=f2r.getMsg();
			params[i][9]=f2r.getPro_time();
			params[i][10]=f2r.getTimes();
			params[i][11]=f2r.getValues();
			params[i][12]=f2r.getPh();
			params[i][13]=f2r.getMsg();
		}
		qr.batch(sb.toString(), params);
	}

	private static List<Focast2HRain> getPosition(String sqlNotIn) throws SQLException{
		String sql="select  lat,lng,county_name,county_weather from  b_weaher_china_city where 1=1 and " + sqlNotIn;
		
		return qr.query(sql, new BeanListHandler<Focast2HRain>(Focast2HRain.class));
	}

	
	//获取3小时温度预报与图片
		public static void get3Temp() throws SQLException{
			String jsonList=HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/fo/json/t3h_list.json", "callback=getData&_="+System.currentTimeMillis(),1,null,null);
//			 System.out.println(jsonList.replace("getData(", "").replace(")", ""));
			   JSONObject json = (JSONObject) JSON.parse(jsonList.replace("getData(", "").replace(")", ""));
			   JSONArray  arr = JSON.parseArray(json.getString("datas"));
			   String  proType= json.getString("proType");
			   String  picDt=json.getString("picDt");
			   ProImg pi=null;
			   List<ProImg> list=new ArrayList<>();
			   JSONObject jo=null;
			   for (int i = 0; i < arr.size(); i++) {
				   pi=new ProImg();
				   jo=(JSONObject) arr.get(i);
				   pi.setDir("img/t3h");
				   pi.setPicDt(picDt);
				   pi.setProType(proType);
				   pi.setDt(jo.getString("dt"));
				   pi.setPicPath(jo.getString("picPath"));
				   HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/fo/images/t3h/"+((JSONObject) arr.get(i)).getString("picPath"), null, 2,((JSONObject) arr.get(i)).getString("picPath"),"img/t3h");
				   list.add(pi);
			   }
			   proData2Db(list);
		}
		
		
		//获取小时整点实况温度与图片
		public static void getRealTemp() throws SQLException{
			String jsonList=HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/sk/json/t_list.json", "callback=getData&_="+System.currentTimeMillis(),1,null,null);
//			 System.out.println(jsonList.replace("getData(", "").replace(")", ""));
			JSONObject json = (JSONObject) JSON.parse(jsonList.replace("getData(", "").replace(")", ""));
			   JSONArray arr = JSON.parseArray(json.getString("datas"));
			   String  proType= json.getString("proType");
			   String  picDt=json.getString("picDt");
			   ProImg pi=null;
			   List<ProImg> list=new ArrayList<>();
			   JSONObject jo=null;
			   for (int i = 0; i < arr.size(); i++) {
				   pi=new ProImg();
				   jo=(JSONObject) arr.get(i);
				   pi.setDir("img/t");
				   pi.setPicDt(picDt);
				   pi.setProType(proType);
				   pi.setDt(jo.getString("dt"));
				   pi.setPicPath(jo.getString("picPath"));
				   HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/sk/images/t/"+jo.getString("picPath"), null, 2,jo.getString("picPath"),"img/t");
				   list.add(pi);
			   }
			   proData2Db(list);
		}
		
		//获取小时整点降水实况
		public static void getRealRain() throws SQLException{
			String jsonList=HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/sk/json/r_list.json", "callback=getData&_="+System.currentTimeMillis(),1,null,null);
//			System.out.println(jsonList);  
			JSONObject json = (JSONObject) JSON.parse(jsonList.replace("getData(", "").replace(")", ""));
			   JSONArray arr = JSON.parseArray(json.getString("datas"));
			   String  proType= json.getString("proType");
			   String  picDt=json.getString("picDt");
			   ProImg pi=null;
			   List<ProImg> list=new ArrayList<>();
			   JSONObject jo=null;
			   for (int i = 0; i < arr.size(); i++) {
				   pi=new ProImg();
				   jo=(JSONObject) arr.get(i);
				   pi.setDir("img/r");
				   pi.setPicDt(picDt);
				   pi.setProType(proType);
				   pi.setDt(jo.getString("dt"));
				   pi.setPicPath(jo.getString("picPath"));
//				   System.out.println(proType+"?"+picDt+"?"+((JSONObject) arr.get(i)).getString("dt")+((JSONObject) arr.get(i)).getString("picPath"));
				   HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/sk/images/r/"+jo.getString("picPath"), null, 2,jo.getString("picPath"),"img/r");
				   list.add(pi);
			   }
			   
				proData2Db(list);
		}
		
		
		//获取临近雷达图片10分钟
		public static void getRadar() throws SQLException{
					String jsonList=HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/radar/radar_list_new.json", "_="+System.currentTimeMillis(),1,null,null);
					JSONObject json = JSON.parseObject(jsonList.replace("var fc40 =", ""));
//		            System.out.println(json.getString("stime"));	
		            JSONArray jsonarr = JSON.parseArray(json.getString("value"));
		            JSONObject jo=null;
		            ProRdarImg pri=null;
		            List<ProRdarImg> list=new ArrayList<>();
		            for (int i = 0; i < jsonarr.size(); i++) {
		            	 pri=new ProRdarImg();
		            	 jo=(JSONObject) jsonarr.get(i);
		            	 String str= jo.getString("path").replace("[\"", "").replace("\"]", "");
		            	 String[] arrStr = str.split("\",\"");
		            	 pri.setPro_item_time(jo.getString("time"));
		            	 pri.setPro_time(jo.getString("date").replace("[\"", "").replace("\"]", ""));
		            	 pri.setPro_path(jo.getString("path"));
		            	 pri.setPro_dir("img/5m");
		            	 for (int j = 0; j < arrStr.length; j++) {
//		            		 System.out.println(arrStr[j].substring(3));
		            		 HttpRequest.sendGet("http://d1.weather.com.cn/newwebgis/radar/"+arrStr[j], null, 2,arrStr[j].substring(3),"img/5m");
						  }
		            	 list.add(pri);
		            	  //System.out.println(jo.getString("date")+jo.getString("time")+jo.getString("path"));
					}
		            proRadarData2Db(list);
		          
		}

		
		
		
		private static void proRadarData2Db(List<ProRdarImg> list) throws SQLException {
			StringBuilder sql=new StringBuilder();
			Object[][] params=new Object[list.size()][6]; 
			sql.append("INSERT INTO   d_pro_radar_img ")
			  .append("( pro_time,pro_item_time,pro_path,pro_dir,update_time)")
			  .append(" VALUES  (?, ?, ?, ? , now())")			
			  .append(" ON DUPLICATE KEY UPDATE  ")
			  .append(" update_time=now(),")
			  .append(" pro_item_time=?,")
			  .append(" pro_path=?");//批量
			ProRdarImg pi=null;
			for (int i = 0; i < list.size(); i++) {
				pi=list.get(i);
				params[i][0]=pi.getPro_time();
				params[i][1]=pi.getPro_item_time();
				params[i][2]=pi.getPro_path();
				params[i][3]=pi.getPro_dir();
				//更新参数
				params[i][4]=pi.getPro_item_time();
				params[i][5]=pi.getPro_path();
			}
//			System.out.println(sql.toString());
		 qr.batch(sql.toString(), params);
		}

		public static void proData2Db(List<ProImg> list) throws SQLException{
			StringBuilder sql=new StringBuilder();
			Object[][] params=new Object[list.size()][5]; 
			sql.append("INSERT INTO   d_pro_img ")
			  .append("( proType,picDt,dt,picPath,dir,update_time)")
			  .append(" VALUES  (?, ?, ?, ? , ? , now())")			
			  .append(" ON DUPLICATE KEY UPDATE  ")
			  .append(" update_time=now()");//批量
			   ProImg pi=null;
				for (int i = 0; i < list.size(); i++) {
					pi=list.get(i);
					params[i][0]=pi.getProType();
					params[i][1]=pi.getPicDt();
					params[i][2]=pi.getDt();
					params[i][3]=pi.getPicPath();
					params[i][4]=pi.getDir();
				}
//				System.out.println(sql.toString());
			qr.batch(sql.toString(), params);
		}
		
		
		
		
		
		
	public static void main(String[] args) {
		try {
			getRadar();
//			getRealRain();
//			getRealTemp();
//			get3Rain();
//			get3Temp();
//			getComingRain(" province_name in('甘肃') ");
//			 String json = HttpRequest.gizpContent("http://d1.weather.com.cn/radar/JC_RADAR_CHN_JB.html?jsoncallback=readerinfo&dataType=jsonp&cache=!1&",
//					 "dataType=jsonp&cache=!1",
//					 1, null, null);
////			 readerinfo({"cn":"中国","ys":"雷达基本反射率","radars":[{'fn':'ebref_achn','ft':'20170622133600001','dt':'2017-06-22 21:36'},{'fn':'ebref_achn','ft':'20170622134200001','dt':'2017-06-22 21:42'},{'fn':'ebref_achn','ft':'20170622134800001','dt':'2017-06-22 21:48'},{'fn':'ebref_achn','ft':'20170622135400001','dt':'2017-06-22 21:54'},{'fn':'ebref_achn','ft':'20170622140000001','dt':'2017-06-22 22:00'},{'fn':'ebref_achn','ft':'20170622140600001','dt':'2017-06-22 22:06'},{'fn':'ebref_achn','ft':'20170622141200001','dt':'2017-06-22 22:12'},{'fn':'ebref_achn','ft':'20170622141800001','dt':'2017-06-22 22:18'},{'fn':'ebref_achn','ft':'20170622142400001','dt':'2017-06-22 22:24'},{'fn':'ebref_achn','ft':'20170622143000001','dt':'2017-06-22 22:30'},{'fn':'ebref_achn','ft':'20170622143600001','dt':'2017-06-22 22:36'},{'fn':'ebref_achn','ft':'20170622144200001','dt':'2017-06-22 22:42'},{'fn':'ebref_achn','ft':'20170622144800001','dt':'2017-06-22 22:48'},{'fn':'ebref_achn','ft':'20170622145400001','dt':'2017-06-22 22:54'},{'fn':'ebref_achn','ft':'20170622150000001','dt':'2017-06-22 23:00'},{'fn':'ebref_achn','ft':'20170622150600001','dt':'2017-06-22 23:06'},{'fn':'ebref_achn','ft':'20170622151200001','dt':'2017-06-22 23:12'},{'fn':'ebref_achn','ft':'20170622151800001','dt':'2017-06-22 23:18'},{'fn':'ebref_achn','ft':'20170622152400001','dt':'2017-06-22 23:24'},{'fn':'ebref_achn','ft':'20170622153000001','dt':'2017-06-22 23:30'},{'fn':'ebref_achn','ft':'20170622153600001','dt':'2017-06-22 23:36'},{'fn':'ebref_achn','ft':'20170622154200001','dt':'2017-06-22 23:42'},{'fn':'ebref_achn','ft':'20170622154800001','dt':'2017-06-22 23:48'},{'fn':'ebref_achn','ft':'20170622155400001','dt':'2017-06-22 23:54'},{'fn':'ebref_achn','ft':'20170622160000001','dt':'2017-06-23 00:00'},{'fn':'ebref_achn','ft':'20170622160600001','dt':'2017-06-23 00:06'},{'fn':'ebref_achn','ft':'20170622161200001','dt':'2017-06-23 00:12'},{'fn':'ebref_achn','ft':'20170622161800001','dt':'2017-06-23 00:18'},{'fn':'ebref_achn','ft':'20170622162400001','dt':'2017-06-23 00:24'},{'fn':'ebref_achn','ft':'20170622163000001','dt':'2017-06-23 00:30'},{'fn':'ebref_achn','ft':'20170622163600001','dt':'2017-06-23 00:36'},{'fn':'ebref_achn','ft':'20170622164200001','dt':'2017-06-23 00:42'},{'fn':'ebref_achn','ft':'20170622164800001','dt':'2017-06-23 00:48'},{'fn':'ebref_achn','ft':'20170622165400001','dt':'2017-06-23 00:54'},{'fn':'ebref_achn','ft':'20170622170000001','dt':'2017-06-23 01:00'},{'fn':'ebref_achn','ft':'20170622170600001','dt':'2017-06-23 01:06'},{'fn':'ebref_achn','ft':'20170622171200001','dt':'2017-06-23 01:12'},{'fn':'ebref_achn','ft':'20170622171800001','dt':'2017-06-23 01:18'},{'fn':'ebref_achn','ft':'20170622172400001','dt':'2017-06-23 01:24'},{'fn':'ebref_achn','ft':'20170622173000001','dt':'2017-06-23 01:30'},{'fn':'ebref_achn','ft':'20170622173600001','dt':'2017-06-23 01:36'},{'fn':'ebref_achn','ft':'20170622174200001','dt':'2017-06-23 01:42'},{'fn':'ebref_achn','ft':'20170622174800001','dt':'2017-06-23 01:48'},{'fn':'ebref_achn','ft':'20170622175400001','dt':'2017-06-23 01:54'},{'fn':'ebref_achn','ft':'20170622180000001','dt':'2017-06-23 02:00'},{'fn':'ebref_achn','ft':'20170622180600001','dt':'2017-06-23 02:06'},{'fn':'ebref_achn','ft':'20170622181200001','dt':'2017-06-23 02:12'},{'fn':'ebref_achn','ft':'20170622181800001','dt':'2017-06-23 02:18'},{'fn':'ebref_achn','ft':'20170622182400001','dt':'2017-06-23 02:24'},{'fn':'ebref_achn','ft':'20170622183000001','dt':'2017-06-23 02:30'},{'fn':'ebref_achn','ft':'20170622183600001','dt':'2017-06-23 02:36'},{'fn':'ebref_achn','ft':'20170622184200001','dt':'2017-06-23 02:42'},{'fn':'ebref_achn','ft':'20170622184800001','dt':'2017-06-23 02:48'},{'fn':'ebref_achn','ft':'20170622185400001','dt':'2017-06-23 02:54'},{'fn':'ebref_achn','ft':'20170622190000001','dt':'2017-06-23 03:00'},{'fn':'ebref_achn','ft':'20170622190600001','dt':'2017-06-23 03:06'},{'fn':'ebref_achn','ft':'20170622191200001','dt':'2017-06-23 03:12'},{'fn':'ebref_achn','ft':'20170622191800001','dt':'2017-06-23 03:18'},{'fn':'ebref_achn','ft':'20170622192400001','dt':'2017-06-23 03:24'},{'fn':'ebref_achn','ft':'20170622193000001','dt':'2017-06-23 03:30'},{'fn':'ebref_achn','ft':'20170622193600001','dt':'2017-06-23 03:36'},{'fn':'ebref_achn','ft':'20170622194200001','dt':'2017-06-23 03:42'},{'fn':'ebref_achn','ft':'20170622194800001','dt':'2017-06-23 03:48'},{'fn':'ebref_achn','ft':'20170622195400001','dt':'2017-06-23 03:54'},{'fn':'ebref_achn','ft':'20170622200000001','dt':'2017-06-23 04:00'},{'fn':'ebref_achn','ft':'20170622200600001','dt':'2017-06-23 04:06'},{'fn':'ebref_achn','ft':'20170622201200001','dt':'2017-06-23 04:12'},{'fn':'ebref_achn','ft':'20170622201800001','dt':'2017-06-23 04:18'},{'fn':'ebref_achn','ft':'20170622202400001','dt':'2017-06-23 04:24'},{'fn':'ebref_achn','ft':'20170622203000001','dt':'2017-06-23 04:30'},{'fn':'ebref_achn','ft':'20170622203600001','dt':'2017-06-23 04:36'},{'fn':'ebref_achn','ft':'20170622204200001','dt':'2017-06-23 04:42'},{'fn':'ebref_achn','ft':'20170622204800001','dt':'2017-06-23 04:48'},{'fn':'ebref_achn','ft':'20170622205400001','dt':'2017-06-23 04:54'},{'fn':'ebref_achn','ft':'20170622210000001','dt':'2017-06-23 05:00'},{'fn':'ebref_achn','ft':'20170622210600001','dt':'2017-06-23 05:06'},{'fn':'ebref_achn','ft':'20170622211200001','dt':'2017-06-23 05:12'},{'fn':'ebref_achn','ft':'20170622211800001','dt':'2017-06-23 05:18'},{'fn':'ebref_achn','ft':'20170622212400001','dt':'2017-06-23 05:24'},{'fn':'ebref_achn','ft':'20170622213000001','dt':'2017-06-23 05:30'},{'fn':'ebref_achn','ft':'20170622213600001','dt':'2017-06-23 05:36'},{'fn':'ebref_achn','ft':'20170622214200001','dt':'2017-06-23 05:42'},{'fn':'ebref_achn','ft':'20170622214800001','dt':'2017-06-23 05:48'},{'fn':'ebref_achn','ft':'20170622215400001','dt':'2017-06-23 05:54'},{'fn':'ebref_achn','ft':'20170622220000001','dt':'2017-06-23 06:00'},{'fn':'ebref_achn','ft':'20170622220600001','dt':'2017-06-23 06:06'},{'fn':'ebref_achn','ft':'20170622221200001','dt':'2017-06-23 06:12'},{'fn':'ebref_achn','ft':'20170622221800001','dt':'2017-06-23 06:18'},{'fn':'ebref_achn','ft':'20170622222400001','dt':'2017-06-23 06:24'},{'fn':'ebref_achn','ft':'20170622223000001','dt':'2017-06-23 06:30'},{'fn':'ebref_achn','ft':'20170622223600001','dt':'2017-06-23 06:36'},{'fn':'ebref_achn','ft':'20170622224200001','dt':'2017-06-23 06:42'},{'fn':'ebref_achn','ft':'20170622224800001','dt':'2017-06-23 06:48'},{'fn':'ebref_achn','ft':'20170622225400001','dt':'2017-06-23 06:54'},{'fn':'ebref_achn','ft':'20170622230000001','dt':'2017-06-23 07:00'},{'fn':'ebref_achn','ft':'20170622230600001','dt':'2017-06-23 07:06'},{'fn':'ebref_achn','ft':'20170622231200001','dt':'2017-06-23 07:12'},{'fn':'ebref_achn','ft':'20170622231800001','dt':'2017-06-23 07:18'},{'fn':'ebref_achn','ft':'20170622232400001','dt':'2017-06-23 07:24'},{'fn':'ebref_achn','ft':'20170622233000001','dt':'2017-06-23 07:30'},{'fn':'ebref_achn','ft':'20170622233600001','dt':'2017-06-23 07:36'},{'fn':'ebref_achn','ft':'20170622234200001','dt':'2017-06-23 07:42'},{'fn':'ebref_achn','ft':'20170622234800001','dt':'2017-06-23 07:48'},{'fn':'ebref_achn','ft':'20170622235400001','dt':'2017-06-23 07:54'},{'fn':'ebref_achn','ft':'20170623000000001','dt':'2017-06-23 08:00'},{'fn':'ebref_achn','ft':'20170623000600001','dt':'2017-06-23 08:06'},{'fn':'ebref_achn','ft':'20170623001200001','dt':'2017-06-23 08:12'},{'fn':'ebref_achn','ft':'20170623001800001','dt':'2017-06-23 08:18'},{'fn':'ebref_achn','ft':'20170623002400001','dt':'2017-06-23 08:24'},{'fn':'ebref_achn','ft':'20170623003000001','dt':'2017-06-23 08:30'},{'fn':'ebref_achn','ft':'20170623003600001','dt':'2017-06-23 08:36'},{'fn':'ebref_achn','ft':'20170623004200001','dt':'2017-06-23 08:42'},{'fn':'ebref_achn','ft':'20170623004800001','dt':'2017-06-23 08:48'},{'fn':'ebref_achn','ft':'20170623005400001','dt':'2017-06-23 08:54'},{'fn':'ebref_achn','ft':'20170623010000001','dt':'2017-06-23 09:00'},{'fn':'ebref_achn','ft':'20170623010600001','dt':'2017-06-23 09:06'},{'fn':'ebref_achn','ft':'20170623011200001','dt':'2017-06-23 09:12'},{'fn':'ebref_achn','ft':'20170623011800001','dt':'2017-06-23 09:18'},{'fn':'ebref_achn','ft':'20170623012400001','dt':'2017-06-23 09:24'}]})
//			 JSONObject obj = JSON.parseObject(json);
//			 JSONArray jarr = JSON.parseArray(obj.getString("radars"));
//			 JSONObject imgjson = JSON.parseObject(jarr.get(jarr.size()-1).toString());
//			 System.out.println(imgjson.getString("ft"));
		} catch (Exception e) {
//			e.printStackTrace();
		}
		
	}
	
}
